package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/index")
@RestController
public class IndexController {
    @Value("${server.port}")
    Integer serverPort;
    @Value("${spring.application.name}")
    String applicationName;

    @RequestMapping("/hello")
    public String hello() {
        return "This service name is :" + applicationName + ",and port is : " + serverPort;
    }
}
